package xyz.erupt.annotation.fun;

import lombok.Getter;
import lombok.Setter;
import xyz.erupt.annotation.config.Comment;
import xyz.erupt.annotation.sub_erupt.Power;

/**
 * @author YuePeng
 * date 2020-08-07
 */
@Getter
@Setter
public class PowerObject {

    private boolean add;

    private boolean delete;

    private boolean edit;

    private boolean editLayoutVertical;

    private boolean query;

    private boolean viewDetails;

    private boolean export;

    private boolean importable;

    @Comment("在edit=false时，是否允许对个别字段进行edit")
    private boolean editField;

    @Comment("在editField=true时，指明允许编辑的字段名")
    private String[] editFieldName;

    public PowerObject(Power power) {
        this.add = power.add();
        this.delete = power.delete();
        this.edit = power.edit();
        this.editLayoutVertical = power.editLayoutVertical();
        this.query = power.query();
        this.viewDetails = power.viewDetails();
        this.export = power.export();
        this.importable = power.importable();

        this.editField = power.editField();
        this.editFieldName = power.editFieldName();
    }

    public PowerObject() {

    }
}
